package com.qianli.cashmama.trade.openApi.job;

import com.qianli.cashmama.trade.common.utils.TradeConfigUtil;
import com.robert.vesta.util.IpUtils;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @program: dc-cashmama-trade-center
 * @description
 * @author: frank
 * @create: 2020-12-04 12:04
 **/
@Service
@Log4j2
public class PullOpenOrderStatusJob {

    @Autowired
    private TradeConfigUtil configUtil;

    @Scheduled(cron = "0 5 * * * ?")
    public void run() {
        String hostIp = IpUtils.getHostIp();
        log.info("==开启拉取订单状态==,ip:{}", hostIp);

        if (!hostIp.equals(configUtil.pushJobRunIp())) {
            log.info("==开启拉取订单状态任务==, 当前机器ip不是job执行机器,当前iP:{},目标IP:{}", hostIp, configUtil.pushJobRunIp());
            return;
        }


    }
}
